d_str="hello,Mokkaya!"

print(f"这是一个新的字符串{d_str[:6]+'fe'}")
#字符串格式化
name="jianye"
age=25
print(f"我是{name},今年{age}")
print("我是%s,今年%d"%(name,age))
print("我是{}今年{}".format(name,age))
print(d_str.count("a"))
print(d_str.capitalize())
print(d_str.endswith("v!"))
try:
    print(d_str.index("5"))
except:
    print("报错了")
spac_data="  111  A  33  "
print(spac_data.lower())
print(spac_data.strip())
print(spac_data.find("5"))
print(spac_data.replace("111","666"))
#列表
data_list=["mokkaya","data","vendor","reseller"]
data_list2=['Google', 'Runoob', 'Taobao']
num_list=['1', '2', '3']
print(data_list[0])
print(data_list.append("666"))
print(data_list[1:-2])
print(data_list2 + data_list)
print(len(data_list))
if "666" in data_list :
    print("tt")
print(max(data_list))
data_list.sort()
print(data_list)
print(data_list.pop(2))
print(data_list)
#字典
data_dict={"name":"建业","age":"25"}
print(len(data_dict))
print(type(data_dict))
if "name"  in data_dict.keys():
    print("tt")
else:
    print("ffff")
#修改字典
data_dict["name"]="fangfang"
print(data_dict)
#添加对象
data_dict["sex"]="man"
print(data_dict)
print(data_dict.get("nam", "5555"))
#集合
